<template>
  <div>
      <span>个人中心</span> 
      <table border="1">
          <tr><td>账号</td><td>密码</td><td>头像</td><td>性别</td><td>手机号</td><td>操作</td></tr>
          <tr>
              <td>{{userInfos.username}}</td>
              <td>{{userInfos.pwd}}</td>
              <td>{{userInfos.imgurl}}</td>
              <td>{{userInfos.gendar}}</td>
              <td>{{userInfos.phone}}</td>
              <td @click='toRegEdit'>修改</td>
          </tr>
      </table>


  </div>
</template>

<script>
import request from '../request/index.js'
export default {
  data() {
    return {
        userInfos:{}
    };
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {
    this.userInfos=this.$store.state.userInfo
    this.getSex(this.userInfos.gendar)
  },

  methods: {
      getSex(sex){
           if(sex==0){
               this.userInfos.gendar="男"
           }
           else{
               this.userInfos.gendar="女"
           }
       },
       toRegEdit(){
           this.userInfos.gendar=0
           console.log(this.userInfos)
           this.$router.push("/regEdit")
           
       }
    //this.$router.push("/regEdit");
  },
};
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>